// pages/mine/payList.js
const app=getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    payList:null,
    model:'member',
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var open=wx.getStorageSync('open');
    var appUrl=app.globalData.appUrl;
    var domain=app.globalData.domain;
    this.setData({
      domain:domain,
      appUrl:appUrl
    })
    console.log(open);
    var id=open.id;
    var that=this;
    var data=this.data;
    //console.log(memberId);
    if(id>0){
      wx.request({
        url: appUrl+'fee/getList',
        data:{id:id,member_id:open.member_id,openid:open.mini_openid},
        success:function(res){
          console.log(res);
          that.setData({
            payList:res.data.list,
            count:res.data.count
          })
          
        }
      })

    }else{

    }
    this.setData({
      domain:app.globalData.domain,
        width:app.globalData.windowWidth,
      height:app.globalData.windowHeight,
      statusBarHeight:app.globalData.statusBarHeight,
      navHeight:app.globalData.navHeight,
      marginTop:app.globalData.navTitleTop
    })
  },
  goBack:function(){
    wx.navigateBack();
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },
 goBack:function(){
    wx.navigateBack();
  },
  reFund(e){
    console.log(e);
    var id=e.currentTarget.dataset.id;
    var open=wx.getStorageSync('open');
    var data=this.data;
    let that=this;
    wx.request({
      url: data.appUrl+'member/reFund',
      data:{id:id,open_id:open.id},
      success:function(res){
        console.log(res);
     
        
      }
    })
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})